__author__ = 'zoulida'
import win32api
import win32con
import pywintypes


import tkinter as tk

import time
time.sleep(8)
root = tk.Tk()
width = root.winfo_screenwidth()
height = root.winfo_screenheight()
#print(width)
#print(height)
root.destroy()

print('目前分辨率为', width, height, '重新设置分辨率1920，1080')





devmode = pywintypes.DEVMODEType()

#screenSize = [1280,800]
screenSize = [1920,1080]

devmode.PelsWidth = screenSize[0]
devmode.PelsHeight = screenSize[1]
devmode.Fields = win32con.DM_PELSWIDTH | win32con.DM_PELSHEIGHT
win32api.ChangeDisplaySettings(devmode,0)

root = tk.Tk()
width = root.winfo_screenwidth()
height = root.winfo_screenheight()
#print(width)
#print(height)
root.destroy()

print('最终目前分辨率为', width, height)